<!--********************************************************************
* Copyright© 2000 - 2025 SuperMap Software Co.Ltd. All rights reserved.
*********************************************************************-->
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title data-i18n="resources.title_changeTileVersion"></title>
    <script type="text/javascript" src="../js/include-web.js"></script>
    <script type="text/javascript" include="iclient-ol-css" src="../../dist/ol/include-ol.js"></script>
</head>
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
<script type="text/javascript">
    var baseLayer, url = "https://iserver.supermap.io/iserver/services/map-ChinaProvinces/rest/maps/ChinaProvinces";
    var map = new ol.Map({
        target: 'map',
        // ol v7版本用法为ol.control.defaults.defaults； v6版本以下用法为ol.control.defaults
            controls: ol.control.defaults.defaults({attributionOptions: {collapsed: false}})
            .extend([new ol.supermap.control.Logo({ link: "https://iclient.supermap.io" })]),
        view: new ol.View({
            center: [104.79, 33.03],
            zoom: 4,
            projection: 'EPSG:4326',
            multiWorld: true
        })
    });

    baseLayer = new ol.source.TileSuperMapRest({
        origin: [-180, 90],
        url: url,
        wrapX: true
    });

    map.addLayer(new ol.layer.Tile({
        source: baseLayer,
        projection: 'EPSG:4326'
    }));

    var control = new ol.supermap.control.ChangeTileVersion({
        layer: baseLayer,
        orientation: "horizontal"
    });
    control.setMap(map);
    map.addControl(control);
</script>
</body>
</html>